package jvm;

import java.util.concurrent.*;

public class ThreadExectuorDemo {

  public static void main(String[] args) {
    ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
            2, 2,
            60L, TimeUnit.MILLISECONDS,
            new ArrayBlockingQueue<>(2));
    int i = 0;

    System.out.println(222 | i);
    System.out.println(222 & 221);
    System.out.println(-221 & 221);
    for (i = 0; i < 10; i++) {

      int finalI = i;
      threadPoolExecutor.submit(new Runnable() {

        ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

        @Override
        public void run() {
          System.out.println("hello world!!! " + finalI);
          threadLocal.set(finalI);
          System.out.println("threathName" + Thread.currentThread().getName() + ":" + threadLocal);
          threadLocal.remove();
        }
      });
    }
  }

}
